package com.itheima.controller;

import com.itheima.pojo.JobOption;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    /**
     * 员工职位人数统计
     * @return
     */
    @GetMapping("/empJobData")
    public Result empJobData(){
        JobOption jobOption = reportService.empJobData();
        return Result.success(jobOption);
    }

    /**
     * 员工性别人数统计
     */
    @GetMapping("empGenderData")
    public Result empGenderData(){
        List<Map<String,Object>> dataList = reportService.empGenderData();
        return Result.success(dataList);
    }
}
